﻿using SignalBox.Core.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SignalBoxEditor.UI
{
    public partial class frmTrackProperties : Form
    {
        public frmTrackProperties(TrackCell tc)
        {
            InitializeComponent();

            if (tc.TrackCellType.Category == "ENTRYEXIT")
            {

                nameTextBox.Visible = true;
                nameLabel.Visible = true;
                
            }
            else if (tc.TrackCellType.Category == "TRACK")
            {
                nameTextBox.Visible = true;
                nameLabel.Visible = true;
                platformLabel.Visible = true;
                platformTextBox.Visible = true;
            }


            trackCellBindingSource.DataSource = tc;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            trackCellBindingSource.EndEdit();
            Close();
        }
    }
}
